/*
 * Copyright (c) 2025 EasyAdmin
 * All rights reserved.
 *
 * This file is part of the [EasAdmin] project.
 * Unauthorized copying of this file, via any medium, is strictly prohibited.
 * Proprietary and confidential.
 *
 * Author: EasyAdmin ( 1073602@qq.com )
 * Website: https://www.xhxiao.com
 */
package com.easy.module.system.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.easy.framework.common.validate.Add;
import com.easy.framework.common.validate.Update;
import com.easy.framework.database.entity.SimpleEntity;
import com.easy.framework.poi.annotation.Excel;
import com.easy.framework.poi.annotation.Option;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
import jakarta.validation.constraints.Size;
import lombok.Getter;
import lombok.Setter;

/**
 * 字典类型表 实体
 *
 * @author EasyAdmin ( 1073602@qq.com )
 * @date 2025-08-19
 */
@Getter
@Setter
@TableName("sys_dict")
public class SysDict extends SimpleEntity
{
    private static final long serialVersionUID = 1L;

    /**
     * 编号
     */
    @Excel(name = "编号")
    @NotNull(message = "数据不存在",groups = {Update.class})
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 字典名称
     */
    @Excel(name = "字典名称")
    @NotBlank(message = "字典名称不能为空")
    @Size(min = 0, max = 50, message = "字典名称长度不能超过50个字符",groups = {Add.class, Update.class})
    private String dictName;

    /**
     * 字典代码
     */
    @Excel(name = "字典代码")
    @NotBlank(message = "字典代码不能为空",groups = {Add.class, Update.class})
    @Size(min = 0, max = 32, message = "字典代码类型长度不能超过32个字符",groups = {Add.class, Update.class})
    @Pattern(regexp = "^[a-z][a-z0-9_]*$", message = "字典代码必须以字母开头，且只能为（小写字母，数字，下滑线）",groups = {Add.class, Update.class})
    private String dictCode;

    /**
     * 状态（0正常 1停用）
     */
    @Excel(
            name = "状态",
            options = {
                    @Option(value = "0", name = "正常"),
                    @Option(value = "1", name = "停用")
            }
    )
    private Integer status;

    /**
     * 备注
     */
    @Excel(name = "备注")
    private String remark;


}
